/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.com.foxline.model;

import br.com.foxline.enums.Gender;
import br.com.foxline.enums.TypeDocument;
import br.com.foxline.util.Caracter;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

/**
 *
 * @author ely
 */
@Entity
public class People implements Serializable {

    @Id
    @SequenceGenerator(sequenceName = "seq_people", name = "seq_people", allocationSize = 1)
    @GeneratedValue(generator = "seq_people", strategy = GenerationType.SEQUENCE)
    private Long id;
    private String name;
    private String cpf;
    private String cnpj;
    @Enumerated(EnumType.STRING)
    private TypeDocument tipoDocumento;
    private String rg;
    private String organ;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date nasc;
    @OneToOne
    private Address address;
    
    private String localNascimentoPais;
    @ManyToOne
    private Country localNascimentoUF;
    private String localResidenciaPais;
    @ManyToOne
    private Country localResidenciaUF;
    @ManyToOne
    private City localResidenciaMunicipio;
    @Enumerated(EnumType.STRING)
    private Gender gender;
    private String OAB;
    private String UFOAB;

    private String father;
    private String mother;
    
    public People() {
    }

    public People(Long id, String name, String cpf, String rg, String organ, Date nasc, Address address) {
        this.id = id;
        this.name = name;
        this.cpf = cpf;
        this.rg = rg;
        this.organ = organ;
        this.nasc = nasc;
        this.address = address;
    }
    

    public String getFather() {
        return father;
    }

    public void setFather(String father) {
        this.father = father;
    }

    public String getMother() {
        return mother;
    }

    public void setMother(String mother) {
        this.mother = mother;
    }
    
    

    public String getOAB() {
        return OAB;
    }

    public String getUFOAB() {
        return UFOAB;
    }

    public void setUFOAB(String UFOAB) {
        this.UFOAB = UFOAB;
    }

    public void setOAB(String OAB) {
        this.OAB = OAB;
    }

    public Gender getGender() {
        return gender;
    }

    public void setGender(Gender gender) {
        this.gender = gender;
    }

    public String getLocalNascimentoPais() {
        return localNascimentoPais;
    }

    public void setLocalNascimentoPais(String localNascimentoPais) {
        this.localNascimentoPais = localNascimentoPais;
    }

    public Country getLocalNascimentoUF() {
        return localNascimentoUF;
    }

    public void setLocalNascimentoUF(Country localNascimentoUF) {
        this.localNascimentoUF = localNascimentoUF;
    }

    public City getLocalResidenciaMunicipio() {
        return localResidenciaMunicipio;
    }

    public void setLocalResidenciaMunicipio(City localResidenciaMunicipio) {
        this.localResidenciaMunicipio = localResidenciaMunicipio;
    }

    public Country getLocalResidenciaUF() {
        return localResidenciaUF;
    }

    public void setLocalResidenciaUF(Country localResidenciaUF) {
        this.localResidenciaUF = localResidenciaUF;
    }

    

    public String getLocalResidenciaPais() {
        return localResidenciaPais;
    }

    public void setLocalResidenciaPais(String localResidenciaPais) {
        this.localResidenciaPais = localResidenciaPais;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCnpj() {
        return Caracter.removecaracter(cnpj);
    }

    public void setCnpj(String cnpj) {
        this.cnpj = Caracter.removecaracter(cnpj);
    }
    
    public TypeDocument getTipoDocumento() {
        return tipoDocumento;
    }

    public void setTipoDocumento(TypeDocument tipoDocumento) {
        this.tipoDocumento = tipoDocumento;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getCpf() {
        return Caracter.removecaracter(cpf);
    }

    public void setCpf(String cpf) {
        
        this.cpf = Caracter.removecaracter(cpf);
    }

    public String getRg() {
        return rg;
    }

    public void setRg(String rg) {
        this.rg = rg;
    }

    public String getOrgan() {
        return organ;
    }

    public void setOrgan(String organ) {
        this.organ = organ;
    }

    public Date getNasc() {
        return nasc;
    }

    public void setNasc(Date nasc) {
        this.nasc = nasc;
    }

    public Address getAddress() {
        return address;
    }

    public void setAddress(Address address) {
        this.address = address;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final People other = (People) obj;
        if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
            return false;
        }
        if ((this.name == null) ? (other.name != null) : !this.name.equals(other.name)) {
            return false;
        }
        if ((this.cpf == null) ? (other.cpf != null) : !this.cpf.equals(other.cpf)) {
            return false;
        }
        if ((this.cnpj == null) ? (other.cnpj != null) : !this.cnpj.equals(other.cnpj)) {
            return false;
        }
        if (this.tipoDocumento != other.tipoDocumento) {
            return false;
        }
        if ((this.rg == null) ? (other.rg != null) : !this.rg.equals(other.rg)) {
            return false;
        }
        if ((this.organ == null) ? (other.organ != null) : !this.organ.equals(other.organ)) {
            return false;
        }
        if (this.nasc != other.nasc && (this.nasc == null || !this.nasc.equals(other.nasc))) {
            return false;
        }
        if (this.address != other.address && (this.address == null || !this.address.equals(other.address))) {
            return false;
        }
        if ((this.localNascimentoPais == null) ? (other.localNascimentoPais != null) : !this.localNascimentoPais.equals(other.localNascimentoPais)) {
            return false;
        }
        if ((this.localNascimentoUF == null) ? (other.localNascimentoUF != null) : !this.localNascimentoUF.equals(other.localNascimentoUF)) {
            return false;
        }
        if ((this.localResidenciaPais == null) ? (other.localResidenciaPais != null) : !this.localResidenciaPais.equals(other.localResidenciaPais)) {
            return false;
        }
        if ((this.localResidenciaUF == null) ? (other.localResidenciaUF != null) : !this.localResidenciaUF.equals(other.localResidenciaUF)) {
            return false;
        }
        if ((this.localResidenciaMunicipio == null) ? (other.localResidenciaMunicipio != null) : !this.localResidenciaMunicipio.equals(other.localResidenciaMunicipio)) {
            return false;
        }
        if (this.gender != other.gender) {
            return false;
        }
        if ((this.OAB == null) ? (other.OAB != null) : !this.OAB.equals(other.OAB)) {
            return false;
        }
        if ((this.UFOAB == null) ? (other.UFOAB != null) : !this.UFOAB.equals(other.UFOAB)) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 5;
        hash = 59 * hash + (this.id != null ? this.id.hashCode() : 0);
        hash = 59 * hash + (this.name != null ? this.name.hashCode() : 0);
        hash = 59 * hash + (this.cpf != null ? this.cpf.hashCode() : 0);
        hash = 59 * hash + (this.cnpj != null ? this.cnpj.hashCode() : 0);
        hash = 59 * hash + (this.tipoDocumento != null ? this.tipoDocumento.hashCode() : 0);
        hash = 59 * hash + (this.rg != null ? this.rg.hashCode() : 0);
        hash = 59 * hash + (this.organ != null ? this.organ.hashCode() : 0);
        hash = 59 * hash + (this.nasc != null ? this.nasc.hashCode() : 0);
        hash = 59 * hash + (this.address != null ? this.address.hashCode() : 0);
        hash = 59 * hash + (this.localNascimentoPais != null ? this.localNascimentoPais.hashCode() : 0);
        hash = 59 * hash + (this.localNascimentoUF != null ? this.localNascimentoUF.hashCode() : 0);
        hash = 59 * hash + (this.localResidenciaPais != null ? this.localResidenciaPais.hashCode() : 0);
        hash = 59 * hash + (this.localResidenciaUF != null ? this.localResidenciaUF.hashCode() : 0);
        hash = 59 * hash + (this.localResidenciaMunicipio != null ? this.localResidenciaMunicipio.hashCode() : 0);
        hash = 59 * hash + (this.gender != null ? this.gender.hashCode() : 0);
        hash = 59 * hash + (this.OAB != null ? this.OAB.hashCode() : 0);
        hash = 59 * hash + (this.UFOAB != null ? this.UFOAB.hashCode() : 0);
        return hash;
    }

    @Override
    public String toString() {
        return "People{" + "id=" + id + ", name=" + name + ", cpf=" + cpf + ", cnpj=" + cnpj + ", tipoDocumento=" + tipoDocumento + ", rg=" + rg + ", organ=" + organ + ", nasc=" + nasc + ", address=" + address + ", localNascimentoPais=" + localNascimentoPais + ", localNascimentoUF=" + localNascimentoUF + ", localResidenciaPais=" + localResidenciaPais + ", localResidenciaUF=" + localResidenciaUF + ", localResidenciaMunicipio=" + localResidenciaMunicipio + ", gender=" + gender + ", OAB=" + OAB + ", UFOAB=" + UFOAB + '}';
    }

   


}
